﻿using JiaBloggingSite.Core.Objects;
using System.Collections.Generic;

namespace JiaBloggingSite.Core
{
    public interface IBlogRepository
    {
        #region Posts
        IList<Post> Posts(int PageNo, int PageSize);
        IList<Post> Posts(int pageNo, int pageSize, string sortColumn, bool sortByAscending);
        int TotalPosts(bool checkIsPublished = true);
        Post Post(int year, int month, string titleSlug);
        #endregion Posts

        #region Categories
        IList<Category> Categories();

        IList<Post> PostsForCategory(string categoryslug, int pageNo, int pageSize);
        int TotalPostsForCategory(string categorySlug);
        Category Category(string categorySlug);
        Category Category(int id);
        #endregion Categories

        #region Tags
        IList<Tag> Tags();

        IList<Post> PostsForTag(string tagSlug, int pageNo, int pageSize);
        int TotalPostsForTag(string tagSlug);
        Tag Tag(string tagSlug);
        Tag Tag(int id);
        #endregion Tags

        #region Search
        IList<Post> PostsForSearch(string search, int pageNo, int pageSize);
        int TotalPostsForSearch(string search);
        #endregion Search

        #region Management
        int AddPost(Post post);
        void EditPost(Post post);
        void DeletePost(int id);

        int AddCategory(Category category);
        void EditCategory(Category category);
        void DeleteCategory(int id);

        int AddTag(Tag tag);
        void EditTag(Tag tag);
        void DeleteTag(int id);
        #endregion

    }
}
